package top.jsjkxyjs.blackbox.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebConfig implements WebMvcConfigurer {
	@Autowired
	@Qualifier(value = "loginInterceptor")
	private HandlerInterceptor handlerInterceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(handlerInterceptor).addPathPatterns("/**").excludePathPatterns(
				"/login",
				"/layuiadmin/**",
				"/frame/**",
				"/css/**",
				"/js/**",
				"/img/**",
				"/user/",
				"/dologin",
				"/register",
				"/databaseawareness"
		);
	}
}
